package com.itheima.consumer;

import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/*@SpringBootApplication
*//*
    @EnableDiscoveryClient：支持注册中心zk/eureka/nacos
    @EnableEurekaClient: 仅支持eureka
    @SpringCloudApplication: 是一个组合注解：@SpringBootApplication+@EnableDiscoveryClient+@EnableCircuitBreaker
 *//*
@EnableDiscoveryClient
@EnableCircuitBreaker //开启熔断器支持*/

@EnableFeignClients //开启feign支持
@SpringCloudApplication
@EnableHystrixDashboard //开启监控支持
public class ConsumerApp {


    public static void main(String[] args) {
        SpringApplication.run(ConsumerApp.class,args);
    }

    //注入到容器中
    @Bean
    @LoadBalanced //使用ribbon负载
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
